package top.glkj.hms.controller.room;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import top.glkj.hms.entity.HotelFacilities;
import top.glkj.hms.service.HotelFacilitiesService;
import top.glkj.hms.utils.Result;

/**
 * @author : xgl
 * @version : 0.0.1
 * @date :2021/2/28 17:53
 */
@Api(tags = "房价管理")
@RestController
@RequestMapping("/hotel")
public class HotelFacilitiesController {
    private final HotelFacilitiesService hotelFacilitiesService;

    public HotelFacilitiesController(HotelFacilitiesService hotelFacilitiesService) {
        this.hotelFacilitiesService = hotelFacilitiesService;
    }
    @ApiOperation("添加资产")
    @PostMapping
    public Result addHotelFacilities(HotelFacilities hotelFacilities) {
        return hotelFacilitiesService.addHotelFacilities(hotelFacilities);
    }
    @ApiOperation("删除资产")
    @DeleteMapping("/delete")
    public Result deleteHotelFacilities(HotelFacilities hotelFacilities) {
        return hotelFacilitiesService.delete(hotelFacilities);
    }
    @ApiOperation("修改资产")
    @PutMapping
    public Result updateHotelFacilities(HotelFacilities hotelFacilities) {
        return hotelFacilitiesService.updateHotelFacilities(hotelFacilities);
    }
    @ApiOperation("移除资产")
    @DeleteMapping
    public Result reomveHotelFacilities(HotelFacilities hotelFacilities) {
        return hotelFacilitiesService.remove(hotelFacilities);
    }
    @ApiOperation("添加资产")
    @GetMapping("/{size}/{page}")
    public Result getAllByPageAndSize(@PathVariable("page") int page,@PathVariable("size") int size) {
        return hotelFacilitiesService.getAllHotelFacilitiesByPageAndSize(page,size);
    }
}
